﻿@model HelloWorld.Code.DataAccess.Message

@{
    ViewBag.Title = "Contact Us";
}

<h2>Contact Us</h2>
<hr/>
@Html.ValidationSummary(true)
@using (Html.BeginForm("ContactUs", "Home", FormMethod.Post))
{
    @Html.LabelFor(model => model.Name, new { @class = "control-label" })
    @Html.TextBoxFor(model => model.Name)
    @Html.ValidationMessageFor(model => model.Name)
    <br/>
    @Html.LabelFor(model => model.Email, new { @class = "control-label" })
    @Html.TextBoxFor(model => model.Email)
    @Html.ValidationMessageFor(model => model.Email)
    <br/>
    @Html.LabelFor(model => model.ContactReasonId, new { @class = "control-label" })
    @Html.DropDownListFor(model => model.ContactReasonId, Model.ContactReasonsList)
    @Html.ValidationMessageFor(model => model.ContactReasonId)
    <br/>
    @Html.LabelFor(model => model.Subject, new { @class = "control-label" })
    @Html.TextBoxFor(model => model.Subject)
    @Html.ValidationMessageFor(model => model.Subject)
    <br/>
    @Html.LabelFor(model => model.Message1, new { @class = "control-label" })
    @Html.TextAreaFor(model => model.Message1)
    @Html.ValidationMessageFor(model => model.Message1)
    <br/>          
    <input type="submit" name="Save" value="Save" />  
}

@if (ViewBag.SaveResult != null && ViewBag.SaveResult)
{
    <span style="color: green;">@ViewBag.SaveResultMessage</span>
}
@if (ViewBag.SaveResult != null && !ViewBag.SaveResult)
{
    <span style="color: red;">@ViewBag.SaveResultMessage</span>
}